public class DNode<E>{
	// Instance variables:
	private E element;
	private DNode<E> next;
	/**
	 * Creates a node with null references to its element, previous node and next node.
	 */
	public DNode() {
		this(null, null);
	}
	/**
	 * Creates a new node
	 * @param e element stored
	 * @param n Next node
	 */
	public DNode(E e,DNode<E> n) {
		element = e;
		next = n;
	}
	// Accessor methods:
	public E getElement() {
		return element;
	}
	public DNode<E> getNext() {
		return next;
	}
	// Modifier methods:
	public void setElement(E newElem) {
		this.element = newElem;
	}
	public void setNext(DNode<E> newNext) {
		this.next = newNext;
	}
	
	@Override
	public String toString() {
		return element.toString();
	}
}